package com.dz51.core.log4j.impl;

import org.apache.log4j.Logger;

import com.dz51.core.log4j.ILog4jManager;
/**
 * @Title: Log4jManagerImpl.java
 * @Package com.dz51.core.log4j
 * @Description: ILog4jManager管理器实现
 * @author Zhaoqt  
 * @date 2014-5-4 上午3:07:03
 * @version V1.0
 */
public class Log4jManagerImpl implements ILog4jManager {

	 private Logger defaultLog;
	
	/**
	 * save excption log></p>
	 * @Title: saveExceptionLog
	 * @param className
	 * @param methodName
	 * @param logStr
	 * @param e
	 * @return void
	 */
	public void saveExceptionLog(String className, String methodName,
			String logStr, Exception e) {
	    defaultLog.error("class [" + className + "] method [" + methodName + "] error : " + logStr, e);
	}
	

	/**
	 * error log</p>
	 * @Title: errorCustomLog
	 * @param className
	 * @param methodName
	 * @param logStr
	 * @return void
	 */
	public void errorCustomLog(String className, String methodName,
			String logStr) {
	    defaultLog.error("class [" + className + "] method [" + methodName + "] error : " + logStr);
	}
	
	/**
	 * debug log </p>
	 * @Title: debugCustomLog
	 * @param className
	 * @param methodName
	 * @param logStr
	 * @return void
	 */
	public void debugCustomLog(String className, String methodName,
			String logStr) {
		 defaultLog.debug("class [" + className + "] method [" + methodName + "] debug : " + logStr);
	}
	
	/**
	 * info log </p>
	 * @Title: infoCustomLog
	 * @param className
	 * @param methodName
	 * @param logStr
	 * @return void
	 */
	public void infoCustomLog(String className, String methodName, String logStr) {
		 defaultLog.info("class [" + className + "] method [" + methodName + "] info : " + logStr);
	}
	
	/**
	 * warn log </p>
	 * @Title: warnCustomLog
	 * @param className
	 * @param methodName
	 * @param logStr
	 * @return void
	 */
	public void warnCustomLog(String className, String methodName, String logStr) {
		 defaultLog.warn("class [" + className + "] method [" + methodName + "] warn : " + logStr);
	}


	public Logger getDefaultLog() {
		return defaultLog;
	}


	public void setDefaultLog(Logger defaultLog) {
		this.defaultLog = defaultLog;
	}
	
}
